package org.finesys.common.sensitive.core.annotation.regex;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import org.finesys.common.sensitive.core.annotation.base.SensitiveInfo;
import org.finesys.common.sensitive.core.handler.regex.EmailSensitiveHandler;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@SensitiveInfo(handler = EmailSensitiveHandler.class)
public @interface EmailSensitive {

	/**
	 * 匹配的正则
	 */
	String regex() default "(^.)[^@]*(@.*$)";

	/**
	 * 替换规则
	 */
	String replacer() default "$1****$2";

}
